<div class="<%= params[:tagged_with].present? ? 'tag-list filtered' : 'tag-list' %>">
  <% p = params.dup %>
  <h2><%= Alchemy.t("Filter by tag") %></h2>
  <%= js_filter_field '.tag-list li' %>
  <ul>
    <%= render_tag_list(resource_model.name, p) %>
  </ul>
  <% if p[:tagged_with].present? %>
    <%= link_to(
      render_icon('delete-small') + Alchemy.t('Remove tag filter'),
      url_for(p.delete_if { |k, v| k == "tagged_with" }.merge(action: 'index')),
      remote: request.xhr?,
      class: 'button small with_icon please_wait'
    ) %>
  <% end %>
</div>
